Skip to content
This repository has been archived by the owner on Oct 1, 2022. It is now read-only.

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Dilly committed Jan 15, 2017
1 parent 4a14e72 commit 755dc0b
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions source/ask/alexaskill.d
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ struct CustomIntent
string name;
}

/++
/++
+ Abstract base class to inherit your skill from.
+
+ There are two ways to implement a alexa intent:
+ 1) add a @CustomIntent annotation to a method in your skill class
+ 2) create an intent class inheriting from `BaseIntent` and register it using `addIntent`
+ * add a @CustomIntent annotation to a method in your skill class
+ * create an intent class inheriting from `BaseIntent` and register it using `addIntent`
+/
abstract class AlexaSkill(T) : ITextManager
{
Expand All @@ -31,15 +31,15 @@ abstract class AlexaSkill(T) : ITextManager
///
private BaseIntent[] intents;

/++
/++
+ constructor that requires the loca table as input
+
+ params:
+ text = loca table to use for that request
+
+ see_also:
+ `AlexaText`, `LocaParser`
+/
+ `AlexaText`, `LocaParser`
+/
public this(AlexaText[] text)
{
localeText = text;
Expand Down Expand Up @@ -82,12 +82,12 @@ abstract class AlexaSkill(T) : ITextManager
onSessionEnd(event, context);

return result;
}
}

/++
/++
+ adds an intent handler
+
+ see_also:
+
+ see_also:
+ `BaseIntent`
+/
public void addIntent(BaseIntent intent)
Expand All @@ -98,7 +98,7 @@ abstract class AlexaSkill(T) : ITextManager

/++
+ returns the localized text string depending on the loaded locale database
+
+
+ see_also:
+ `this`, `ITextManager`
+/
Expand All @@ -125,7 +125,7 @@ abstract class AlexaSkill(T) : ITextManager
static if(isPublic && hasUDA!(__traits(getMember, T, member), CustomIntent))
{
enum name = getUDAs!(__traits(getMember, T, member), CustomIntent)[0].name;

if(event.request.intent.name == name)
{
mixin("return (cast(T)this)."~member~"(event, context);");
Expand All @@ -148,7 +148,7 @@ abstract class AlexaSkill(T) : ITextManager
if(baseIntent.name == eventIntent)
return baseIntent.onIntent(event,context);
}

stderr.writefln("onIntent did not match: %s",eventIntent);
return AlexaResult();
}
Expand All @@ -158,4 +158,4 @@ abstract class AlexaSkill(T) : ITextManager
{
throw new Exception("not implemented");
}
}
}

0 comments on commit 755dc0b

Please sign in to comment.